//
//  MXUserHeadView.m
//  Stratups
//
//  Created by 王启颖 on 2019/2/27.
//  Copyright © 2019 王启颖. All rights reserved.
//

#import "PCUserHeadView.h"
@interface PCUserHeadView ()
@property (weak, nonatomic) IBOutlet UILabel *name_lbl;
@property (weak, nonatomic) IBOutlet UIImageView *userHeader_image;
@end
@implementation PCUserHeadView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self initHeaderData];
}

- (void)initHeaderData {
    
    self.backgroundColor = kUIToneBackgroundColor;
    
    [self.userHeader_image changeCornerRadius:self.userHeader_image.frameSizeHeight/2];
    
//    MXUserMessage *message = [MXUserMessageTool message];
//    self.name_lbl.text = message.user_nickname;
//
//    [self.userHeader_image sd_setImageWithURL:[NSURL URLWithString:message.user_headimg] placeholderImage:[UIImage imageNamed:@"photoAndVideoDefault"]];
    
    
}

- (void)setUser:(User *)user{
    _user = user;
    self.name_lbl.text = user.user_nickname;
    [self.userHeader_image sd_setImageWithURL:[NSURL URLWithString:user.user_headimg] placeholderImage:[UIImage imageNamed:@"photoAndVideoDefault"]];
}

+ (instancetype)initPCUserHeadView {
    return NSbunleloadNibName(@"PCUserHeadView");
}

@end
